package com.octopus.yangj.customized.rule;

import com.octopus.kernal.model.BaseStruct;
import com.octopus.kernal.service.BusinessRuleInterface;
import com.octopus.yangj.customized.model.CustomizedEmployeeRoleStruct;
import com.octopus.yangj.generated.model.EmployeeRoleStruct;

public class RoleDeleteRule implements BusinessRuleInterface{

	@Override
	public boolean isAllowed(BaseStruct struct) {
		EmployeeRoleStruct role = (EmployeeRoleStruct)struct;
		if(role.getId() == CustomizedEmployeeRoleStruct.ROLE_ADMIN 
				|| role.getId() == CustomizedEmployeeRoleStruct.ROLE_USER){
			return false;
		}else{
			return true;
		}
	}

}
